package com.ellricky.baselib.ui.clue

import android.content.Intent
import androidx.fragment.app.Fragment
import com.andr.common.util.ResUtil
import com.ellricky.baselib.BaseConstant
import com.ellricky.baselib.BaseConstant.*
import com.ellricky.baselib.R
import com.ellricky.baselib.ui.base.BaseTabVpActivity

/**
 * 执行校长->课程顾问->我的线索
 */
class MyClueActivity : BaseTabVpActivity() {

    private lateinit var id: String

    override fun initUIView() {
        id = intent.getStringExtra(KEY_ID) ?: ""
        super.initUIView()
    }

    override fun getFragmentList(): MutableList<Fragment> {
        val fragments = ArrayList<Fragment>()
        fragments.add(MyClueChildFragment.newInstance(CLUE_TYPE_WAIT, id))
        fragments.add(MyClueChildFragment.newInstance(CLUE_TYPE_WISH, id))
        fragments.add(MyClueChildFragment.newInstance(CLUE_TYPE_TY, id))
        fragments.add(MyClueChildFragment.newInstance(CLUE_TYPE_FINISH, id))
        return fragments
    }

    override fun getTabTitleList(): List<String> {
        return ResUtil.getStrArr(this, R.array.MyClueTab).asList()
    }

    override fun getTitleRes(): Int {
        return R.string.base_my_clue
    }


    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (resultCode > 0) {
            val curFrg = tabVp.curFrg as MyClueChildFragment
            curFrg.loadDataOnInit()
        }

    }
}
